package com.sctvcloud.renhe.http;

import java.lang.reflect.Type;
import java.util.List;

/**
 * Created by Ly on 2016/11/29.
 */
public abstract class AbsListNetCallback<T> extends AbsNetCallBack<List<T>> implements IPage<NetResponseObjectArray<T>> {
    protected int calledIndex;
    protected NetResponseObjectArray<T> responseObj;

    public AbsListNetCallback(int pageIndex) {
        this(null);
        this.calledIndex = pageIndex;
    }

    public AbsListNetCallback(Type type) {
        super(type);
    }

    public AbsListNetCallback(Type type, int calledIndex) {
        super(type);
        this.calledIndex = calledIndex;
    }

    public AbsListNetCallback(Type type, Object obj, int calledIndex) {
        super(type);
        this.obj=obj;
        this.calledIndex = calledIndex;
    }

    @Override
    public void onPrepare() {

    }

    @Override
    public void onError(Throwable ex, String errorMsg) {

    }

    @Override
    public void onEnd() {

    }

    @Override
    public AbsListNetCallback<T> setInt1(int int1) {
        super.setInt1(int1);
        return this;
    }

    @Override
    public AbsListNetCallback<T> setInt2(int int2) {
        super.setInt2(int2);
        return this;
    }

    @Override
    public AbsListNetCallback<T> setObj(Object obj) {
        super.setObj(obj);
        return this;
    }

    @Override
    public void setPageResponse(NetResponseObjectArray<T> tNetResponseObjectArray) {
        this.responseObj = tNetResponseObjectArray;
    }

    @Override
    public NetResponseObjectArray<T> getPageResponse() {
        return responseObj;
    }
}
